{extend name="common/application" /}
{block name="title"}<title>政务资讯-知产企业</title>{/block}
{block name="css"}
<link rel="stylesheet" href="_CSS_/company.css" />
<link rel="stylesheet" href="_CSS_/policys.css" />
<!--[if lt IE 9]>
	<script src="http://www.ijquery.cn/js/html5shiv.js"></script>
<![endif]-->
{/block}
{block name="navbar"}{include file="/common/navbar" /}{/block}
{block name="content"}
<!-- 主体内容 -->
<div class="main">
	<!--综合示范名单-->
	<div class="list">  
	   <span style="white-space:pre;"></span><span class="line"></span>  
	   <span style="white-space:pre;"></span><span class="txt">综合示范名单</span>  
	   <span style="white-space:pre;"></span><span class="line"></span>
	   <p>Intergrated demonstration unit</p>
	</div> 
	<!--选择地区-->
	<div class="zc-box1 normalBox clearfix hide">
		<div class="choose-local">
			<span>选择地域：</span>
			<div id="city" class="fl">
				<select class="prov"></select> -
				<select class="city"></select> 
			</div>
		</div>					
	</div>
	<!--企业名单-->
	<div class="companyItem company normalBox" value="1">
		<div class="leftCon fl">
			<span class="icons icon-company"></span>
			<span class="icons icon-company-active hide"></span>
			<span class="title">企业名单</span>
			<span class="feature">知产企业，实力强大</span>
		</div>
		<div class="rightCon fl">
			<!--无数据-->
			<div class="nodatas hide">
				<img src="_IMG_/null01.png">
				<p>抱歉，暂无数据!</p>
			</div>
			<div class="lists" id="company"></div>
		</div>
	</div>
	<!--机构名单-->
	<div class="companyItem organization normalBox" value="2">
		<div class="leftCon fl">
			<span class="icons icon-organs"></span>
			<span class="icons icon-organs-active hide"></span>
			<span class="title">机构名单</span>
			<span class="feature">安全机构，保障权益</span>
		</div>
		<div class="rightCon fl">
			<!--无数据-->
			<div class="nodatas hide">
				<img src="_IMG_/null01.png">
				<p>抱歉，暂无数据!</p>
			</div>
			<div class="lists" id="organs"></div>
		</div>
	</div>
	<!--代理人名单-->
	<div class="companyItem agent normalBox" value="3">
		<div class="leftCon fl">
			<span class="icons icon-agents"></span>
			<span class="icons icon-agents-active hide"></span>
			<span class="title">专业代理人名单</span>
			<span class="feature">单独个体，专业服务</span>
		</div>
		<div class="rightCon fl">
			<!--无数据-->
			<div class="nodatas hide">
				<img src="_IMG_/null01.png">
				<p>抱歉，暂无数据!</p>
			</div>
			<div class="lists" id="agents"></div>
			
		</div>
	</div>

</div>
{/block}

{block name="js"}
<script src="_JS_/jquery.cityselect.js"></script>
<script src="_P_/layer/layer.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	/*企业名单数据读取*/
	$.ajax({
		type: "get",
		url: "/index.php/api/Companys/company_index",
		dataType: 'jsonp',
		jsonp: 'callback',
		data: {
			'type': 1,
		},
		success: function(msg) {
			if(msg.code == 200) {
				for(var i = 0; i < msg.data.length; i++){
					var id = msg.data[i].id;
					var name = msg.data[i].name;
					var phone = msg.data[i].phone;
					var address = msg.data[i].address;
					var html  = '';
						html += '<a class="listItem" id="'+ id +'" href="javascript:;">';
						html += '<span class="names text_overflow">'+ name +'</span>';
						html += '<span class="phones">'+ phone +'</span>';
						html += '<span class="areas text_overflow" title="'+ address +'">'+ address +'</span></a>';
					
						$('#company').append(html);		
				}
				/*企业悬浮*/
				$('.company .listItem').hover(function(){
					$(this).css('background','#828282');
					$(this).find('.names').css('color','#51c79e');
					$(this).find('.phones').css('color','#51c79e');
					$(this).find('.areas').css('color','#51c79e');
				},function(){ 
					$(this).css('background','#666666');
					$(this).find('.names').css('color','#FFFFFF');
					$(this).find('.phones').css('color','#FFFFFF');
					$(this).find('.areas').css('color','#FFFFFF');
				});	
				/*企业详情*/
				$('.company .listItem').on('click',function(){
					var id=$(this).attr('id');					
					layer.open({
						type: 2,
						title: '企业详情',
						fix: false,
						shadeClose: true,
						scrollbar: false,
						area: ['560px','825px'],
						content: 'company_details01.html?id='+id,
						yes: function(index, layero) {	
							//do something
							layer.close(index); //如果设定了yes回调，需进行手工关闭
						}
					});
				});
				
			}else if(msg.code == 1000) {
				$('.company .nodatas').removeClass('hide');
				$('.company .lists').addClass('hide');
			}else{
				layer.msg('查询失败!', {
					icon: 1,
					time: 1000
				});
			}
		}
	});
	/*机构名单数据读取*/
	$.ajax({
		type: "get",
		url: "/index.php/api/Companys/company_index",
		dataType: 'jsonp',
		jsonp: 'callback',
		data: {
			'type': 2,
		},
		success: function(msg) {
			if(msg.code == 200) {
				for(var i = 0; i < msg.data.length; i++){
					var id = msg.data[i].id;
					var name = msg.data[i].name;
					var phone = msg.data[i].phone;
					var number = msg.data[i].star;
					var html  = '';
						html += '<a class="listItem" id="'+ id +'" href="javascript:;">';
						html += '<span class="names text_overflow">'+ name +'</span>';
						html += '<span class="phones">'+ phone +'</span><div class="stars">';
						for(var j = 0; j<number;j++){
							html += '<span class="icons icon-stars"></span>';
						}
						for(var k = 0; k < (5-number); k++){
							html += '<span class="icons icon-stars-grey"></span>';
						}
						html += '</div></a>';
						$('#organs').append(html);							
				}
				/*机构悬浮*/
				$('.organization .listItem').hover(function(){
					$(this).css('background','#828282');
					$(this).find('.names').css('color','#76bcfd');
					$(this).find('.phones').css('color','#76bcfd');
					$(this).find('.icon-stars').css('background','url(/static/web/images/lan.png) no-repeat');
				},function(){ 
					$(this).css('background','#666666');
					$(this).find('.names').css('color','#FFFFFF');
					$(this).find('.phones').css('color','#FFFFFF');
					$(this).find('.icon-stars').css('background','url(/static/web/images/bai.png) no-repeat');
				});	
				/*机构详情*/
				$('.organization .listItem').on('click',function(){
					var id=$(this).attr('id');
					layer.open({
						type: 2,
						title: '机构详情',
						fix: false,
						shadeClose: true,
						scrollbar: false,
						area: ['560px','825px'],
						content: 'company_details02.html?id='+id,
						yes: function(index, layero) {
							//do something
							layer.close(index); //如果设定了yes回调，需进行手工关闭
						}
					});
				});
				
			}else if(msg.code == 1000) {
				$('.organization .nodatas').removeClass('hide');
				$('.organization .lists').addClass('hide');
			}else{
				layer.msg('查询失败!', {
					icon: 1,
					time: 1000
				});
			}
		}
	});
	/*代理人名单数据读取*/
	$.ajax({
		type: "get",
		url: "/index.php/api/Companys/company_index",
		dataType: 'jsonp',
		jsonp: 'callback',
		data: {
			'type': 3,
		},
		success: function(msg) {
			if(msg.code == 200) {
				for(var i = 0; i < msg.data.length; i++){
					var id = msg.data[i].id;
					var name = msg.data[i].name;
					var username = msg.data[i].username;
					var number = msg.data[i].star;
					var html  = '';
						html += '<a class="listItem" id="'+ id +'" href="javascript:;">';
						html += '<span class="agentnames text_overflow">'+ username +'</span>';
						html += '<span class="companys text_overflow" title="'+name+'">'+ name +'</span><div class="stars">';
						for(var j = 0; j<number;j++){
							html += '<span class="icons icon-stars"></span>';
						}
						for(var k = 0; k < (5-number); k++){
							html += '<span class="icons icon-stars-grey"></span>';
						}
						html += '</div></a>';
						$('#agents').append(html);							
				}
				/*代理人悬浮*/
				$('.agent .listItem').hover(function(){
					$(this).css('background','#828282');
					$(this).find('.agentnames').css('color','#fc9258');
					$(this).find('.companys').css('color','#fc9258');
					$(this).find('.icon-stars').css('background','url(/static/web/images/cheng.png) no-repeat');
				},function(){ 
					$(this).css('background','#666666');
					$(this).find('.agentnames').css('color','#FFFFFF');
					$(this).find('.companys').css('color','#FFFFFF');
					$(this).find('.icon-stars').css('background','url(/static/web/images/bai.png) no-repeat');
				});
				/*代理人详情*/
				$('.agent .listItem').on('click',function(){
					var id=$(this).attr('id');
					layer.open({
						type: 2,
						title: '代理人详情',
						fix: false,
						shadeClose: true,
						scrollbar: false,
						area: ['560px','525px'],
						content: 'company_details03.html?id='+id,
						yes: function(index, layero) {
							//do something
							layer.close(index); //如果设定了yes回调，需进行手工关闭
						}
					});
				});
			}else if(msg.code == 1000) {
				$('.agent .nodatas').removeClass('hide');
				$('.agent .lists').addClass('hide');
			}else{
				layer.msg('查询失败!', {
					icon: 1,
					time: 1000
				});
			}
		}
	});	
	
	/*企业名单*/
	$('.company').hover(function(){
		$(this).children('.leftCon').css('background','#51c79e');
		$(this).children('.rightCon').css('background','#666666');
		$(this).children('.leftCon').css('border-right','0');
		$('.icon-company').addClass('hide');
		$('.icon-company-active').removeClass('hide');
		$(this).find('.title').css('color','#FFFFFF');
		$(this).find('.feature').css('color','#FFFFFF');
		$(this).find('.names').css('color','#FFFFFF');
		$(this).find('.phones').css('color','#FFFFFF');
		$(this).find('.areas').css('color','#FFFFFF');
		$(this).find('.listItem').css('background','#666666');
	},function(){  
		$(this).children('.leftCon').css('background','#FFFFFF');
		$(this).children('.rightCon').css('background','#FFFFFF');
		$(this).children('.leftCon').css('border-right','2px solid #E5E5E5');
		$('.icon-company').removeClass('hide');
		$('.icon-company-active').addClass('hide');
		$(this).find('.title').css('color','#333333');
		$(this).find('.feature').css('color','#999999');
		$(this).find('.names').css('color','#333333');
		$(this).find('.phones').css('color','#a2a2a2');
		$(this).find('.areas').css('color','#a2a2a2');
		$(this).find('.listItem').css('background','#FFFFFF');
	});
	/*机构*/
	$('.organization').hover(function(){
		$(this).children('.leftCon').css('background','#56a3f2');
		$(this).children('.rightCon').css('background','#666666');
		$(this).children('.leftCon').css('border-right','0');
		$('.icon-organs').addClass('hide');
		$('.icon-organs-active').removeClass('hide');
		$(this).find('.title').css('color','#FFFFFF');
		$(this).find('.feature').css('color','#FFFFFF');
		$(this).find('.names').css('color','#FFFFFF');
		$(this).find('.phones').css('color','#FFFFFF');
		$(this).find('.listItem').css('background','#666666');
		$(this).find('.icon-stars').css('background','url(/static/web/images/bai.png) no-repeat');
	},function(){  
		$(this).children('.leftCon').css('background','#FFFFFF');
		$(this).children('.rightCon').css('background','#FFFFFF');
		$(this).children('.leftCon').css('border-right','2px solid #E5E5E5');
		$('.icon-organs').removeClass('hide');
		$('.icon-organs-active').addClass('hide');
		$(this).find('.title').css('color','#333333');
		$(this).find('.feature').css('color','#999999');
		$(this).find('.names').css('color','#333333');
		$(this).find('.phones').css('color','#a2a2a2');
		$(this).find('.listItem').css('background','#FFFFFF');
		$(this).find('.icon-stars').css('background','url(/static/web/images/huang.png) no-repeat');
	});	
	/*代理人*/
	$('.agent').hover(function(){
		$(this).children('.leftCon').css('background','#fc9258');
		$(this).children('.rightCon').css('background','#666666');
		$(this).children('.leftCon').css('border-right','0');
		$('.icon-agents').addClass('hide');
		$('.icon-agents-active').removeClass('hide');
		$(this).find('.title').css('color','#FFFFFF');
		$(this).find('.feature').css('color','#FFFFFF');
		$(this).find('.agentnames').css('color','#FFFFFF');
		$(this).find('.companys').css('color','#FFFFFF');
		$(this).find('.listItem').css('background','#666666');
		$(this).find('.icon-stars').css('background','url(/static/web/images/bai.png) no-repeat');
	},function(){  
		$(this).children('.leftCon').css('background','#FFFFFF');
		$(this).children('.rightCon').css('background','#FFFFFF');
		$(this).children('.leftCon').css('border-right','2px solid #E5E5E5');
		$('.icon-agents').removeClass('hide');
		$('.icon-agents-active').addClass('hide');
		$(this).find('.title').css('color','#333333');
		$(this).find('.feature').css('color','#999999');
		$(this).find('.agentnames').css('color','#333333');
		$(this).find('.companys').css('color','#a2a2a2');
		$(this).find('.listItem').css('background','#FFFFFF');
		$(this).find('.icon-stars').css('background','url(/static/web/images/huang.png) no-repeat');
	});

	//地区选择
	var city_list = [
		{city: "武汉市"}, 
		{city: "黄石市"}, 
		{city: "十堰市"}, 
		{city: "宜昌市"}, 
		{city: "襄阳市"}, 
		{city: "鄂州市"}, 
		{city: "荆门市"}, 
		{city: "孝感市"},
		{city: "荆州市"}, 
		{city: "黄冈市"}, 
		{city: "咸宁市"}, 
		{city: "随州市"}, 
		{city: "恩施土家族苗族自治州"}, 
		{city: "仙桃市"}, 
		{city: "潜江市"}, 
		{city: "天门市"}, 
		{city: "神农架林区"}
	]
	$("#city").citySelect({
		prov: "湖北省",
		city: "武汉市",
		nodata: "none",
	});
	//初始城市设为武汉市
	var data = [{
		name: '武汉市',
		selected: true
	}];
});
	
	
</script>
{/block}